package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.OpportunityFocusEntity;

import java.util.List;
import java.util.Map;

/**
 * @author long.rao
 * @version v1.0
 * @date 2019/2/1 10:26
 * @since v1.0
 */
public interface OpportunityFocusModel extends IModel<OpportunityFocusEntity> {

    /**
     * 机会关注员工数据插入
     * @param entity 供应商实体
     * @throws XbbException 异常
     * @return Integer
     * @author long.rao
     * @date 2019-02-01 15:39
     */
    @Override
    Integer insert(OpportunityFocusEntity entity) throws XbbException;

    /**
     * 机会关注员工数据更新
     * @param entity 机会关注员工实体
     * @author long.rao
     * @date 2019-02-01 15:39
     * @throws XbbException 异常
     * @return Integer
     */
    @Override
    Integer update(OpportunityFocusEntity entity) throws XbbException;

    /**
     * 机会关注员工数据查询多个
     * @param param 参数
     * @author long.rao
     * @date 2019-02-01 15:39
     * @return List<OpportunityFocusEntity>
     */
    @Override
    List<OpportunityFocusEntity> findEntitys(Map<String, Object> param);

    /**
     * 机会关注员工数据查询条数
     * @param param 参数
     * @author long.rao
     * @date 2019-02-01 15:39
     * @return Integer
     */
    @Override
    Integer getEntitysCount(Map<String, Object> param);

    /**
     * 获取重点共享下的关注客户
     * @param corpid 公司id
     * @return List
     */
    List<Long> getShareOpportunityIdList(String corpid);

    /**
     * 获取重点不共享下个人的关注机会
     * @param userId 用户id
     * @param corpid 公司id
     * @return List
     */
    List<Long> getNoShareOpportunityIdList(String userId, String corpid);

    /**
     * 根据机会id获取个人是否关注
     * @param dataId 数据id
     * @param userId 用户id
     * @param corpid 公司id
     * @return OpportunityFocusEntity
     */
    OpportunityFocusEntity getByOpportunityId(Long dataId, String userId, String corpid);

    /**
     * 重点关注保存
     * @param opportunityFocusEntity 机会
     * @throws XbbException XbbException
     */
    Long save(OpportunityFocusEntity opportunityFocusEntity) throws XbbException;

    /**
     * 重点共享，批量取关
     * @param dataId 数据id
     * @param corpid 公司id
     */
    void unFocusBatch(Long dataId, String corpid);
}
